﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.MiniQuest {
    import flash.events.*;
    import Classes.*;
    import __AS3__.vec.*;

    public class HeadquarterInventoryMQ extends MiniQuest {

        public static const QUEST_NAME:String = "headquarterInventoryMQ";

        private var m_newHeadquarterTypes:Vector.<String>;

        public function HeadquarterInventoryMQ(){
            super(QUEST_NAME);
            m_recurrenceTime = 10;
        }
        public function get isQuestNeeded():Boolean{
            var _local1:Boolean;
            if (!this.m_newHeadquarterTypes){
                this.m_newHeadquarterTypes = Global.franchiseManager.getNewHeadquarterTypes();
            };
            if (this.m_newHeadquarterTypes.length){
                _local1 = true;
            };
            return (_local1);
        }
        public function showQuest():void{
            var _local1:String;
            var _local2:String;
            var _local3:Business;
            if (((this.m_newHeadquarterTypes) && (this.m_newHeadquarterTypes.length))){
                _local1 = this.m_newHeadquarterTypes[0];
                this.m_newHeadquarterTypes.splice(0, 1);
                Global.franchiseManager.grantHeadquarters(_local1);
                _local2 = Global.franchiseManager.getFranchiseTypeFromHeadquarters(_local1);
                _local3 = Global.franchiseManager.getBusinessFromType(_local2);
                if (_local2 != null){
                    FranchiseViralManager.triggerFranchiseViralFeeds(FranchiseViralManager.VIRAL_GROWHQ_FIRST, _local2, "", null, 0, _local3);
                };
            };
        }
        override protected function onIconClicked(_arg1:MouseEvent):void{
            super.onIconClicked(_arg1);
            this.showQuest();
            m_recurrenceTime = 0;
        }
        override protected function endQuest():void{
            super.endQuest();
        }

    }
}//package Classes.MiniQuest 
